package com.activiti.controller;


import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Stencilset {
	 @RequestMapping(value="/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
	  public @ResponseBody String getStencilset() {
	    InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
	    ByteArrayOutputStream   baos   =   new   ByteArrayOutputStream(); 
        int   i=-1; 
        try {
			while((i=stencilsetStream.read())!=-1){ 
			baos.write(i); 
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
       return   baos.toString();
	  }
}
